//   Copyright 2012,2013 Vaughn Vernon
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

package com.saasovation.agilepm.domain.model.product.backlogitem;

import java.util.Collection;

import com.saasovation.agilepm.domain.model.product.ProductId;
import com.saasovation.agilepm.domain.model.product.release.ReleaseId;
import com.saasovation.agilepm.domain.model.product.sprint.SprintId;
import com.saasovation.agilepm.domain.model.tenant.TenantId;

/**
 * 待办事项存储库
 */
public interface BacklogItemRepository {

    /**
     * 所有已提交的待办事项清单
     * @param aTenantId 租户ID
     * @param aSprintId 冲刺ID
     * @return  返回所有已提交的待办事项
     */
    public Collection<BacklogItem> allBacklogItemsComittedTo(TenantId aTenantId, SprintId aSprintId);

    /**
     * 所有已预定的待办事项清单
     * @param aTenantId     租户ID
     * @param aReleaseId    发布ID
     * @return 返回所有已预定的待办事项清单
     */
    public Collection<BacklogItem> allBacklogItemsScheduledFor(TenantId aTenantId, ReleaseId aReleaseId);

    /**
     * 所有优秀产品待办事项清单
     * @param aTenantId     租户ID
     * @param aProductId    产品ID
     * @return  所有优秀产品待办事项清单
     */
    public Collection<BacklogItem> allOutstandingProductBacklogItems(TenantId aTenantId, ProductId aProductId);

    /**
     * 所有待办事项清单
     * @param aTenantId     租户ID
     * @param aProductId    产品ID
     * @return  所有待办事项清单
     */
    public Collection<BacklogItem> allProductBacklogItems(TenantId aTenantId, ProductId aProductId);

    /**
     * 获取ID的待办事项
     * @param aTenantId         租户ID
     * @param aBacklogItemId    待办事项ID
     * @return  返回ID的待办事项
     */
    public BacklogItem backlogItemOfId(TenantId aTenantId, BacklogItemId aBacklogItemId);

    /**
     * 获取下一个身份识别ID
     * @return  返回待办事项ID
     */
    public BacklogItemId nextIdentity();

    /**
     * 移除待办事项
     * @param aBacklogItem  待办事项
     */
    public void remove(BacklogItem aBacklogItem);

    /**
     * 移除所有待办事项清单
     * @param aBacklogItemCollection 所有待办事项清单
     */
    public void removeAll(Collection<BacklogItem> aBacklogItemCollection);

    /**
     * 保存待办事项
     * @param aBacklogItem  待办事项
     */
    public void save(BacklogItem aBacklogItem);

    /**
     * 保存所有待办事项清单
     * @param aBacklogItemCollection   所有待办事项清单
     */
    public void saveAll(Collection<BacklogItem> aBacklogItemCollection);
}
